﻿#if __DEUPLCATED__

using System;
using System.Text;
using System.Drawing;
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;

public static partial class NativeAOT
{
    [UnmanagedCallersOnly(EntryPoint = "funpqv")]
    public static unsafe double funpqv(IntPtr x_ptr,IntPtr b_ptr,int n,double t)
    {
        double * x = (double *)x_ptr.ToPointer();
        double * b = (double *)b_ptr.ToPointer();

    return funpqv(x,b,n,t);
    }

// 计算函数连分式值.cpp
// x存放n个结点值x[0]～x[n-1]。
// b存放连分式中的n+1个参数b[0]～b[n]
// n连分式的节数（注意：常数项b[0]为第0节）
// t自变量值
// 函数返回t处的函数连分式值
//  double funpqv(double x[],double b[],int n,double t)
    public static unsafe double funpqv(double* x,double* b,int n,double t)
  { 
	  int k;
      double u;
      u=b[n];
      for (k=n-1; k>=0; k--)
      { 
		  if (Math.Abs(u)+1.0==1.0)
			  u=1.0e+35*(t-x[k])/Math.Abs(t-x[k]);
          else
			  u=b[k]+(t-x[k])/u;
      }
      return(u);
  }

}

#endif
